*******************************
***Description of Data Files***
*******************************

I privide the following three data files corresponding to: 1) the data description in Tables 2-5; 2) the main results in Tables 7-8 & 10-11.


1. "Summary_Data.dta" contains the data of students' demographic information. 
	
i) age: age 
ii) income: family income 
iii) bt: dummy of whether the student has used BitTorrent recently
iv) internet_hours: average number of hours students spend on internet
v) antivirus_source: the source of antivirus software (0-legal; 1-pirated; 2-download)
vi) office_source: the source of microsoft office (0-legal; 1-pirated; 2-download)
vii) legalwindow: dummy of whether the microsoft windows is legal (1) or not (0)


2. "Data.mat" containd the conjoint data to be used in the MCMC estimation.

i) column 1: student id
ii) column 2: task id (from 1-10)
iii) column 3: options (1-legal version; 2-street-pirated version; 3-internet-pirated version; 4-outside option)
iv) column 4: choice (1-chosen; 2 or 3- not chosen)
v) column 5: monetary price of the choice (in HKD100)
vi) column 6: download time (in days)
vii) column 7: availability of update


3. "Demo.mat" containd the demographic information data to be used in the MCMC estimation.

i) column 1: age
ii) column 2: bt
iii) column 3: income


4. "BayesBeta_normal_1.mat" and "BayesBeta_normal_3.mat" are the draws from MCMC estimation


**************************************
***Description of Replication Files***
**************************************

The following Stata and Matlab files replicate all the results in the paper. The .do file can be executed with Stata 9 or later. The .m files can be executed with Matlab R2010a or later. 


Stata .do file:
* "Summary_Tables.do" produces numbers and estimates for Tables 2-5

Matlab .m files:
* "Result_Tables.m" produces Tables 7, 8 and Figure 2.
* "Counterfactual_Tables.m" produces Tables 10, 11 and Figure 3. 

* "Software.m" is the main file that implement the estimation.
* "clogit.m" is a function file that sets up the first-order condition in a mixed logit.
* "clogit_star.m" is a function file that sets up the first-order condition in a mixed logit (to be used in the psuedo-likelihood for the MH algorithm).
* "Hessian.m" is a function file that calculates the hessian of the logit. 
* "Hessian_star.m" is a function file that calculates the hessian of the logit_star. 
* "bayesmixture.m" is a function file that implement the MCMC and MH algorithm.
* "multireg.m" is a function file that draw sample from a posterior of a multivariate regression model with prior
* "iwish.m" is a function file that draws a variance matrix from inverted wishart distribution.
* "likelihood.m" is a function file that set up the logit likelihood.
* "vline.m" is a function file that draws a vertical line in a figure.
* "elasticity.m" is a function file that calculates elasticities using the draws from estimation.
* "elasticity_stderr.m" is a function file that calculates the 5% and 95% percentiles of the elasticities.
* "counterfactual.m" is a function file that calculates the counterfactual demand and profits using the draws from estimation. 
